﻿using System;
using System.Net;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Data.Linq;
using System.Web;
using System.Text;
using System.Data;
using System.Drawing;
using System.IO;
using System.Data.Objects;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Security.Cryptography;
using System.Management;
using System.Configuration;
using System.Xml;
using System.Data.SqlClient;
using MSBTC.Model;


namespace MSBTC.WinFormHelpers
{
    public class SessionHelper
    {
        //PMSContext dbconn = new PMSContext();
        
        public string Session_GetIP()
        {
            string host;

            host = Dns.GetHostName();
            if (host == null)
            {
                return null;
            }
            else
            {
                //IPAddress[] ipadd = Dns.GetHostAddresses(host);
                IPHostEntry ipEntry = Dns.GetHostEntry(host);
                IPAddress[] addr = ipEntry.AddressList;

                for (int i = 0; i < addr.Length; i++ )
                {
                    //MessageBox.Show("IP Address {0}: {1} " + addr[i].ToString());
                    return addr[i].ToString();
                }
            }
            return null;
        }

       
    }
}